<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us">
<head>
  <link href="//gmpg.org/xfn/11" rel="profile">
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <meta name="generator" content="Hugo 0.69.0" />

  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <title>学习hugo建站遇到的问题以及怎样解决的方法 &middot; 我的博客</title>

  
  <link type="text/css" rel="stylesheet" href="/mysite/css/print.css" media="print">
  <link type="text/css" rel="stylesheet" href="/mysite/css/poole.css">
  <link type="text/css" rel="stylesheet" href="/mysite/css/syntax.css">
  <link type="text/css" rel="stylesheet" href="/mysite/css/hyde.css">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abril+Fatface|PT+Sans:400,400i,700">


  
  <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/apple-touch-icon-144-precomposed.png">
  <link rel="shortcut icon" href="/favicon.png">

  
  
</head>

  <body class="theme-base-0c ">
  <aside class="sidebar">
  <div class="container sidebar-sticky">
    <div class="sidebar-about">
      <a href="/mysite/"><h1>我的博客</h1></a>
      <p class="lead">
       这里是Sunday的个人博客 
      </p>
    </div>

    <nav>
      <ul class="sidebar-nav">
        <li><a href="/mysite/">Home</a> </li>
        
      </ul>
    </nav>

    <p>&copy; 2020. All rights reserved. </p>
  </div>
</aside>

    <main class="content container">
    <div class="post">
  <h1>学习hugo建站遇到的问题以及怎样解决的方法</h1>
  <time datetime=2020-04-22T11:08:36&#43;0800 class="post-date">Wed, Apr 22, 2020</time>
  <h1 id="脑瓜子嗡嗡的">脑瓜子嗡嗡的</h1>
<h2 id="不过还可以接受">不过还可以接受</h2>
<h3 id="加油吧小飞飞">加油吧！小飞飞</h3>
<p>奥利给</p>
<h4 id="搭建博客-">搭建博客 ：</h4>
<p>创建站点：hugo new site 站点名
模板导入，将config修改</p>
<pre><code>config.toml:

&lt;!--线上服务--&gt;
#baseURL = &quot;/mysite/&quot;
&lt;!--线下服务--&gt;
#baseURL = &quot;/&quot;
languageCode = &quot;en-us&quot;
title = &quot;我的博客&quot;
#指定主题
theme = &quot;hyde&quot;

[params]
#博客简介
description = &quot;这里是Sunday的个人博客&quot;
#博客主题颜色
themeColor = &quot;theme-base-0c&quot;

</code></pre><p>解开线下服务！启动hugo  线下可以直接去localhost:1313访问。</p>
<p><img src="/mysite/%E4%B9%94%E5%B7%B4.png" alt="乔巴"></p>
<pre><code># md5加密函数
def md5(raw):
    import hashlib
    md5 = hashlib.md5()
    md5.update(raw.encode('utf8'))
    return md5.hexdigest()

# 生成一个随机数
def generate_string(num=5):
    import random
    str = 'abcdefghijkmnprstuvwxyz1234567890'
    result = ''
    for i in range(num):
        result += str[random.randint(0, 32)]
    return result
</code></pre>
</div>


    </main>

    
  </body>
</html>
